Greek comedy
It is unlikely that Shakespeare would have known the satirical and inventive "old comedy" of Aristophanes, and his contact with the "new comedy" of Menander would have been through his Roman imitators.
Old and new comedy
The Greek comedy probably grew from the often satirical choruses of the feast of Dionysus. Old comedy was episodic in form, the action changing both time and place. Aristophanes targeted the abuses of politicians and the destructiveness of war in comedies of great wit. Eleven of his plays survive, including The Clouds, The Frogs, and the bawdy anti-war play, Lysistrata.
New comedy was more self-consciously literary, and became less satirical, more romantic. Only one of Menander's plays survives in full; most is known about his work through the imitations of it by the Roman authors Plautus and Terence.